package com.xzcedu.mhl.service;

import com.xzcedu.mhl.dao.EmployeeDAO;
import com.xzcedu.mhl.domain.DiningTable;
import com.xzcedu.mhl.domain.Employee;

/**
 * @author 徐州城
 * @version 1.0
 * 该类完成对 employee表的操作(通过调用 EmployeeDAO对象完成)
 */
public class EmployeeService {

    //定义一个 EmployeeDAO属性
    private  EmployeeDAO employeeDAO = new EmployeeDAO();

    //方法，根据 empId和pwd 返回一个Employee对象
    //如果查询不到，就返回null
    public  Employee getEmployeeByIdAndPwd(String empId, String pwd){
        return employeeDAO.querySingle("select * from employee where empId=? and pwd=md5(?)", Employee.class, empId, pwd);
    }
}
